package com.example.bbs.bean;

import android.os.Parcel;
import android.os.Parcelable;

@SuppressWarnings("unused")
public class Comment  {
    private int id=-1;
    private String content;
    private int authorId;
    private int postId;

    public Comment() {

    }

    public Comment(int id, String content, int authorId, int postId) {
        this.id = id;
        this.content = content;
        this.authorId = authorId;
        this.postId = postId;

    }
    public int getId() {
        return id;
    }//评论id

    public void setId(int id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getAuthorId() {
        return authorId;
    }//评论人id

    public void setAuthorId(int authorId) {
        this.authorId = authorId;
    }

    public int getPostId() {
        return postId;
    }

    public void setPostId(int postId) {
        this.postId = postId;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(content);
        dest.writeInt(authorId);
        dest.writeInt(postId);
    }

    public static final Parcelable.Creator<Comment> CREATOR = new Parcelable.Creator<Comment>() {
        @Override
        public Comment createFromParcel(Parcel source) {
            return new Comment(
                    source.readInt(),                       // id
                    source.readString(),                    // content
                    source.readInt(),                       // authorId
                    source.readInt()                       // postId
            );
        }

        @Override
        public Comment[] newArray(int size) {
            return new Comment[size];
        }
    };
}
